package client;

import java.awt.Component;

import javax.swing.*;

public class EmotionRenderer extends DefaultListCellRenderer {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Override
	public Component getListCellRendererComponent(JList list, Object value,
			int index, boolean isSelected, boolean hasFocus) {
		if(value instanceof ImageIcon){
			ImageIcon emot = (ImageIcon)value;
			JLabel label = new JLabel();
			label.setIcon(emot);
			label.setToolTipText(emot.getDescription());
			return label;
			
		}
		return new JLabel();
	}

}
